3.1.67 \(\int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx\) [67]

Optimal. Leaf size=119 \[ \frac {2 c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}} \]

[Out]

2*c^2*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))/f/a^(1/2)-4*c^2*arctan(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/
(a+a*sec(f*x+e))^(1/2))*2^(1/2)/f/a^(1/2)+2*c^2*tan(f*x+e)/f/(a+a*sec(f*x+e))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3989, 3972, 490, 536, 209} \begin {gather*} \frac {2 c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c - c*Sec[e + f*x])^2/Sqrt[a + a*Sec[e + f*x]],x]

[Out]

(2*c^2*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/(Sqrt[a]*f) - (4*Sqrt[2]*c^2*ArcTan[(Sqrt[a]*T
an[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sec[e + f*x]])])/(Sqrt[a]*f) + (2*c^2*Tan[e + f*x])/(f*Sqrt[a + a*Sec[e + f*x
]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 490

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(2*n -
 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(b*d*(m + n*(p + q) + 1))), x] - Dist[e^(2*n)
/(b*d*(m + n*(p + q) + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) + (a*d*(m +
 n*(q - 1) + 1) + b*c*(m + n*(p - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p, q}, x] && NeQ[b*c - a*d
, 0] && IGtQ[n, 0] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3972

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[-2*(a^(m/2 +
 n + 1/2)/d), Subst[Int[x^m*((2 + a*x^2)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 3989

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[((-a)*c)^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps

\begin {align*} \int \frac {(c-c \sec (e+f x))^2}{\sqrt {a+a \sec (e+f x)}} \, dx &=\left (a^2 c^2\right ) \int \frac {\tan ^4(e+f x)}{(a+a \sec (e+f x))^{5/2}} \, dx\\ &=-\frac {\left (2 a^2 c^2\right ) \text {Subst}\left (\int \frac {x^4}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {\left (2 c^2\right ) \text {Subst}\left (\int \frac {2+3 a x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {\left (2 c^2\right ) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}+\frac {\left (8 c^2\right ) \text {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 \sqrt {2} c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}+\frac {2 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.48, size = 124, normalized size = 1.04 \begin {gather*} \frac {2 c^2 \cot \left (\frac {1}{2} (e+f x)\right ) \left (1-\cos (e+f x)+\text {ArcTan}\left (\sqrt {-1+\sec (e+f x)}\right ) \cos (e+f x) \sqrt {-1+\sec (e+f x)}-2 \sqrt {2} \text {ArcTan}\left (\frac {\sqrt {-1+\sec (e+f x)}}{\sqrt {2}}\right ) \cos (e+f x) \sqrt {-1+\sec (e+f x)}\right ) \sec (e+f x)}{f \sqrt {a (1+\sec (e+f x))}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c - c*Sec[e + f*x])^2/Sqrt[a + a*Sec[e + f*x]],x]

[Out]

(2*c^2*Cot[(e + f*x)/2]*(1 - Cos[e + f*x] + ArcTan[Sqrt[-1 + Sec[e + f*x]]]*Cos[e + f*x]*Sqrt[-1 + Sec[e + f*x
]] - 2*Sqrt[2]*ArcTan[Sqrt[-1 + Sec[e + f*x]]/Sqrt[2]]*Cos[e + f*x]*Sqrt[-1 + Sec[e + f*x]])*Sec[e + f*x])/(f*
Sqrt[a*(1 + Sec[e + f*x])])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(328\) vs. \(2(102)=204\).
time = 0.23, size = 329, normalized size = 2.76

method result size
default \(-\frac {c^{2} \left (\cos \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \sqrt {2}+\sqrt {2}\, \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right )+4 \cos \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )+4 \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )-2 \sin \left (f x +e \right )\right ) \sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}}{f \left (\cos \left (f x +e \right )+1\right ) a}\) \(329\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-c^2/f*(cos(f*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*arctanh(1/2*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*sin(f
*x+e)/cos(f*x+e)*2^(1/2))*2^(1/2)+2^(1/2)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*arctanh(1/2*(-2*cos(f*x+e)/(cos
(f*x+e)+1))^(1/2)*sin(f*x+e)/cos(f*x+e)*2^(1/2))+4*cos(f*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*ln((sin(f*x
+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))+4*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*ln((
sin(f*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))-2*sin(f*x+e))*(a*(cos(f*x+e)+1)/cos(
f*x+e))^(1/2)/(cos(f*x+e)+1)/a

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: sign: argument cannot be imaginary
; found %i

________________________________________________________________________________________

Fricas [A]
time = 3.78, size = 473, normalized size = 3.97 \begin {gather*} \left [\frac {2 \, c^{2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) + 2 \, \sqrt {2} {\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) - {\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{a f \cos \left (f x + e\right ) + a f}, \frac {2 \, {\left (c^{2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) - {\left (c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + \frac {2 \, \sqrt {2} {\left (a c^{2} \cos \left (f x + e\right ) + a c^{2}\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )}{\sqrt {a}}\right )}}{a f \cos \left (f x + e\right ) + a f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[(2*c^2*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e) + 2*sqrt(2)*(a*c^2*cos(f*x + e) + a*c^2)*sqrt(-1/
a)*log((2*sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sqrt(-1/a)*cos(f*x + e)*sin(f*x + e) + 3*cos(f*x + e
)^2 + 2*cos(f*x + e) - 1)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1)) - (c^2*cos(f*x + e) + c^2)*sqrt(-a)*log((2*a*
cos(f*x + e)^2 + 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) + a*cos(f*x + e)
 - a)/(cos(f*x + e) + 1)))/(a*f*cos(f*x + e) + a*f), 2*(c^2*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x +
e) - (c^2*cos(f*x + e) + c^2)*sqrt(a)*arctan(sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin
(f*x + e))) + 2*sqrt(2)*(a*c^2*cos(f*x + e) + a*c^2)*arctan(sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*co
s(f*x + e)/(sqrt(a)*sin(f*x + e)))/sqrt(a))/(a*f*cos(f*x + e) + a*f)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} c^{2} \left (\int \left (- \frac {2 \sec {\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a}}\right )\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a}}\, dx + \int \frac {1}{\sqrt {a \sec {\left (e + f x \right )} + a}}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))**2/(a+a*sec(f*x+e))**(1/2),x)

[Out]

c**2*(Integral(-2*sec(e + f*x)/sqrt(a*sec(e + f*x) + a), x) + Integral(sec(e + f*x)**2/sqrt(a*sec(e + f*x) + a
), x) + Integral(1/sqrt(a*sec(e + f*x) + a), x))

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Ch
eck [abs(co

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^2}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c - c/cos(e + f*x))^2/(a + a/cos(e + f*x))^(1/2),x)

[Out]

int((c - c/cos(e + f*x))^2/(a + a/cos(e + f*x))^(1/2), x)

________________________________________________________________________________________